/*(#define BOOST_TEST_MODULE "Test for segment rasterization"

#include <boost/test/unit_test.hpp>
#include <boost/test/test_tools.hpp>
#include <CGAL/Segment_2.h>
#include <CGAL/intersection_2.h>
#include <CGAL/Point_2.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Cartesian.h>*/
#include "predicates.h"
#include "segment_iterator.h"
#include <algorithm>
#include <cmath>
#include <iostream>
#include <fstream>
#include <vector>

/*typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Segment_2<Kernel> Segment;
typedef CGAL::Point_2<Kernel> Point;
typedef CGAL::Point_2<CGAL::Cartesian<double> > Cell;*/

void my_rasterize(segment& segm)
{
    if (segm.first.x > segm.second.x)
    {
        std::swap(segm.first, segm.second);
    }

    std::copy(segment_iterator(segm.first, segm.second), segment_iterator(segm.second), std::ostream_iterator<point>(std::cout,"\n"));
}

/*std::vector<point> checker_rasterize(segment& segm)
{
    if (segm.first.x > segm.second.x)
    {
        std::swap(segm.first, segm.second);
    }

    Segment seg(Point(segm.first.x, segm.first.y), Point(segm.second.x, segm.second.y));
    Cell start_cell(floor(segm.first.x), floor(segm.first.y));
    Cell end_cell(floor(segm.second.x), floor(segm.second.y));
    Cell cur_cell = start_cell;

    std::vector<Cell> correct_ans;
    correct_ans.push_back(start_cell);

    while (cur_cell != end_cell)
    {
        double x = cur_cell.x();
        double y = cur_cell.y();
        bool north = CGAL::do_intersect(seg, Segment(Point(x, y + 1), Point(x + 1, y + 1))) && segm.first.y < segm.second.y;
        bool east = CGAL::do_intersect(seg, Segment(Point(x + 1, y), Point(x + 1, y + 1)));
        bool south = CGAL::do_intersect(seg, Segment(Point(x, y), Point(x + 1, y))) && segm.first.y > segm.second.y;

        if (east)
        {
            x += 1;
        }

        if (north)
        {
            y += 1;
        }

        if (south)
        {
            if (!east)
            {
                y -= 1;
            }
        }

        cur_cell = Cell(x, y);
        correct_ans.push_back(cur_cell);
    }

    std::sort(correct_ans.begin(), correct_ans.end());

    std::vector<point> vect;

    for (auto it = correct_ans.begin(); it < correct_ans.end(); ++it)
    {
        vect.push_back(point(it->x(), it->y()));
    }
    
    return vect;
}*/

int main()
{
    segment segm;
    std::cin >> segm;

    my_rasterize(segm);
}

/*void check(segment& segm)
{
    std::vector<point> checker_result; std::vector<point> my_result;

    checker_result = checker_rasterize(segm);
    my_rasterize(segm);

    
}

BOOST_AUTO_TEST_CASE(usual_cases)
{
    check(segment(point(6.234, 15.6576), point(-2.532, 0.523)));
    check(segment(point(3.6442, 5.23), point(-5.949, 5.21)));
    check(segment(point(0, 0), point(2000, 3000)));
    check(segment(point(-200, 1), point(400, 2)));
    check(segment(point(25, 34), point(20.6, -17)));
    check(segment(point(0.5, 0.5), point(2.5, 2.5)));
    check(segment(point(0.5, 0.5), point(2.5, -1.5)));
    check(segment(point(0.2, 0.6), point(10, -16)));
}

BOOST_AUTO_TEST_CASE(cases_from_assaron_tests) //some random tests from assaron's evaluator repository
{
    check(segment(point(939.72812779247761, 587.43177214637399), point(153.30504439771175, 454.3989677913487)));
    check(segment(point(-587.49730186536908, 863.63417888060212), point(444.63380007073283, 491.23442731797695)));
    check(segment(point(-918.43493701890111, 890.78443497419357), point(44.2708027549088, -621.92494375631213)));
    check(segment(point(836.4016730338335, -81.774441059678793), point(-295.61404464766383, 966.17943793535233)));    
    check(segment(point(-161.18872631341219, 159.85867008566856), point(-144.13027884438634, 651.09839010983706)));
    check(segment(point(879.35550138354301, 986.74852261319757), point(-520.18636837601662, 292.26447641849518)));
    check(segment(point(106.9255112670362, -229.28919969126582), point(444.88722318783402, 317.01283017173409)));
    check(segment(point(251.73034844920039, 422.94163536280394), point(-620.41664682328701, 266.64154231548309)));
    check(segment(point(152.7324435301125, 828.5995782352984), point(-748.38043097406626, 574.23517620190978)));
}

BOOST_AUTO_TEST_CASE(degenerate_cases)
{
    check(segment(point(-100, 5), point(100, 5)));
    check(segment(point(100, 0), point(0, 0)));
}*/